﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_TinhHoaHong : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvDoiTuong")]
        private ADVObjects _AdvDoiTuong;
        [AccessedThroughProperty("AdvTaiKhoanChu")]
        private ADVAccount _AdvTaiKhoanChu;
        [AccessedThroughProperty("AdvTKDoanhThu")]
        private ADVAccount _AdvTKDoanhThu;
        [AccessedThroughProperty("AdvTKThuLai")]
        private ADVAccount _AdvTKThuLai;
        [AccessedThroughProperty("CboLoaiDuLieu")]
        private ComboBox _CboLoaiDuLieu;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CKShowSeriCol")]
        private CheckBox _CKShowSeriCol;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdBoGhiSo")]
        private ToolStripButton _CmdBoGhiSo;
        [AccessedThroughProperty("CmdChuyen")]
        private Button _CmdChuyen;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdGhiSo")]
        private ToolStripButton _CmdGhiSo;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdTimHoaDon")]
        private Button _CmdTimHoaDon;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("ImageList1")]
        private ImageList _ImageList1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label24")]
        private Label _Label24;
        [AccessedThroughProperty("Label25")]
        private Label _Label25;
        [AccessedThroughProperty("Label26")]
        private Label _Label26;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("PNDungChung")]
        private Panel _PNDungChung;
        [AccessedThroughProperty("TabControl1")]
        private TabControl _TabControl1;
        [AccessedThroughProperty("TabControl2")]
        private TabControl _TabControl2;
        [AccessedThroughProperty("TabPage1")]
        private TabPage _TabPage1;
        [AccessedThroughProperty("TabPage2")]
        private TabPage _TabPage2;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripButton2")]
        private ToolStripButton _ToolStripButton2;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayHoaDon")]
        private DateTimePicker _TxtNgayHoaDon;
        [AccessedThroughProperty("TxtNguoiThuHuong")]
        private TextBox _TxtNguoiThuHuong;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoHoaDon")]
        private TextBox _TxtSoHoaDon;
        [AccessedThroughProperty("TxtThuLai")]
        private C1NumericEdit _TxtThuLai;
        [AccessedThroughProperty("TxtThuLaiNT")]
        private C1NumericEdit _TxtThuLaiNT;
        [AccessedThroughProperty("TxtTongHoaHong")]
        private C1NumericEdit _TxtTongHoaHong;
        [AccessedThroughProperty("TxtTongHoaHongNT")]
        private C1NumericEdit _TxtTongHoaHongNT;
        [AccessedThroughProperty("TxtTongThanhToan")]
        private C1NumericEdit _TxtTongThanhToan;
        [AccessedThroughProperty("TxtTongThanhToanNT")]
        private C1NumericEdit _TxtTongThanhToanNT;
        [AccessedThroughProperty("TxtTyGia")]
        private C1NumericEdit _TxtTyGia;
        [AccessedThroughProperty("TxtTyLeThuLai")]
        private C1NumericEdit _TxtTyLeThuLai;
        [AccessedThroughProperty("VSHangHoa")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSHangHoa;
        private string cFrmFormat;
        public string cFrmKhoa;
        public string cFrmKhoaHoaDon;
        private string cFrmKhoaOld;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsXuatKho objHD;
        private clsHoaHong objHH;
        private clsHoaHongChiTiet objHHCT;
        private clsDMLoaiTien objLT;
        private clsSoChungTu objSoCT;

        public Frm_TinhHoaHong()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_TinhHoaHong_KeyDown);
            base.Load += new EventHandler(this.Frm_TinhHoaHong_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.cFrmKhoaHoaDon = "";
            this.mLoaiChungTu = "HHBH";
            this.objSoCT = new clsSoChungTu();
            this.objHD = new clsXuatKho();
            this.objHH = new clsHoaHong();
            this.objLT = new clsDMLoaiTien();
            this.objHHCT = new clsHoaHongChiTiet();
            this.InitializeComponent();
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.TxtTyGia.Value = 0;
            }
            else
            {
                string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                if (strCode != "")
                {
                    this.objLT.LoadByCode(strCode);
                    if (this.objLT.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("0000000000", this.objLT.SoLe);
                    }
                    LVYModule.advFormatNumber(this.TxtTyGia, this.cFrmFormat);
                    if (this.objLT.TienViet == 1)
                    {
                        this.TxtTyGia.Enabled = false;
                    }
                    this.TxtTyGia.Value = this.objLT.TyGia;
                    this.FormatNumber();
                }
            }
        }

        public bool CheckIvalid()
        {
            if (this.TxtSoChungTu.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.AdvDoiTuong.Value.ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn đối tượng được hưởng hoa hồng", ""));
                this.AdvDoiTuong.Focus();
                return false;
            }
            if (this.AdvTKDoanhThu.Value == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập t\x00e0i khoản nợ", ""));
                this.AdvTKDoanhThu.Focus();
                return false;
            }
            if (this.AdvTaiKhoanChu.Value == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập t\x00e0i khoản c\x00f3", ""));
                this.AdvTaiKhoanChu.Focus();
                return false;
            }
            if ((Conversion.Val(RuntimeHelpers.GetObjectValue(this.TxtThuLai.Value)) != 0.0) & (this.AdvTKThuLai.Value.Trim() == ""))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập t\x00e0i khoản trừ tiền lại của kh\x00e1ch h\x00e0ng", ""));
                this.AdvTKThuLai.Focus();
                return false;
            }
            if (this.objHH.TrungSoChungTu(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn phải nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongHoaHongNT.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số tiền hoa hồng phải trả theo c\x00e1c mặt h\x00e0ng", ""));
                this.VSHangHoa.Focus();
                return false;
            }
            return true;
        }

        private void CKShowSeriCol_CheckedChanged(object sender, EventArgs e)
        {
            if (this.CKShowSeriCol.CheckState == CheckState.Checked)
            {
                this.VSHangHoa.Cols[7].Visible = true;
            }
            else
            {
                this.VSHangHoa.Cols[7].Visible = false;
            }
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.objHH.ClearAll();
            this.cFrmKhoa = modGeneral.CreatKey("ST_HoaHong", 15, "HH");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
            this.AdvTKDoanhThu.Value = this.objHD.KhoaTKDoanhThu;
            this.AdvDoiTuong.Value = this.objHD.KhoaDoiTuong;
            this.TxtTyLeThuLai.Value = 0x19;
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((this.cFrmKhoa.Trim() != "") && LVYModule.ConfirmDelete("")) && this.objHH.DeleteData(this.cFrmKhoa))
            {
                this.EmptyData();
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            this.EnabledControl = true;
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_HoaHongList.Show();
            MyProject.Forms.Frm_HoaHongList.BringToFront();
            this.Hide();
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintHoaHong(this.cFrmKhoa);
            }
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            this.TxtDienGiai.Focus();
            if (this.CheckIvalid())
            {
                if (!this.SaveTemp())
                {
                    this.objHH.ClearTemp(this.cFrmKhoa);
                }
                else if (!this.Save())
                {
                    this.objHH.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objHH.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdTimChungTu_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (LVYModule.ReturnIfNull(this.cFrmKhoaHoaDon, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                string[] nColsNumber = new string[] { "4" };
                DataTable listDropDown = this.objHH.GetListDropDown(this.cFrmKhoaHoaDon);
                string[] array = ShowFormModule.ShowPopDropDownBySource(this.TxtSoChungTu, listDropDown, 10, 0, this.cFrmKhoa, nColsNumber, "");
                if ((array != null) && (Information.UBound(array, 1) != 0))
                {
                    string pValue = LVYModule.ReturnIfNull(array[0], "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    if ((LVYModule.ReturnIfNull(pValue, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "") && (this.cFrmKhoa != pValue))
                    {
                        this.cFrmKhoa = pValue;
                        this.ShowData(this.cFrmKhoa);
                    }
                }
            }
        }

        private void CmdTimHoaDon_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_XuatBanList.objFrmCall = this;
            MyProject.Forms.Frm_XuatBanList.ShowDialog();
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoaOld, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            this.EnabledControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.AdvDoiTuong.Value = "";
            this.AdvTKDoanhThu.Value = "";
            this.AdvTaiKhoanChu.Value = "";
            this.TxtSoChungTu.Text = "";
            this.TxtDienGiai.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.VSHangHoa.Rows.Count = 1;
            this.TxtTongHoaHongNT.Value = 0;
            this.TxtTongHoaHong.Value = 0;
            this.TxtTyLeThuLai.Value = 0;
            this.TxtThuLaiNT.Value = 0;
            this.TxtThuLai.Value = 0;
            this.TxtTongThanhToanNT.Value = 0;
            this.TxtTongThanhToan.Value = 0;
            this.TxtSoHoaDon.Text = "";
            this.TxtSoHoaDon.Tag = "";
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.TxtTongHoaHongNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTongHoaHong, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtThuLaiNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtThuLai, modGeneral.H_FORMATNUMBER);
            LVYModule.advFormatNumber(this.TxtTongThanhToanNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTongThanhToan, modGeneral.H_FORMATNUMBER);
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            vSHangHoa.Cols[14].Format = this.cFrmFormat;
            vSHangHoa.Cols[15].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x11].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x13].Format = this.cFrmFormat;
            vSHangHoa = null;
        }

        private void Frm_TinhHoaHong_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode == Keys.Escape)
            {
                if (this.CmdExit.Enabled)
                {
                    this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F2)
            {
                if (this.CmdEdit.Enabled)
                {
                    this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F3)
            {
                this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (keyCode == Keys.F8)
            {
                if (this.CmdAdd.Enabled)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F9)
            {
                if (this.CmdDel.Enabled)
                {
                    this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F10)
            {
                if (this.CmdSave.Enabled)
                {
                    this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F11)
            {
                if (this.CmdUnsave.Enabled)
                {
                    this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if ((keyCode == Keys.F12) && this.CmdPrint.Enabled)
            {
                this.CmdPrint_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        private void Frm_TinhHoaHong_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                if (LVYModule.ReturnIfNull(this.cFrmKhoaHoaDon, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    this.cFrmKhoa = this.objHH.GetKhoaHoaHong(this.cFrmKhoaHoaDon);
                    if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                    {
                        this.ShowData(this.cFrmKhoa);
                    }
                    else
                    {
                        this.ShowDataPhieuXuat(this.cFrmKhoaHoaDon);
                    }
                }
                else if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    this.ShowData(this.cFrmKhoa);
                }
                this.EnabledControl = false;
                this.FormatNumber();
                this.Cursor = Cursors.Default;
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_TinhHoaHong));
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripButton();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.CmdExit = new ToolStripButton();
            this.ToolStripButton2 = new ToolStripButton();
            this.CmdGhiSo = new ToolStripButton();
            this.CmdBoGhiSo = new ToolStripButton();
            this.TabControl2 = new TabControl();
            this.TabPage2 = new TabPage();
            this.VSHangHoa = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.ImageList1 = new ImageList(this.components);
            this.TabControl1 = new TabControl();
            this.TabPage1 = new TabPage();
            this.Label6 = new Label();
            this.TxtNguoiThuHuong = new TextBox();
            this.Label1 = new Label();
            this.AdvTKThuLai = new ADVAccount();
            this.Label26 = new Label();
            this.TxtDienGiai = new TextBox();
            this.Label24 = new Label();
            this.Label25 = new Label();
            this.AdvTKDoanhThu = new ADVAccount();
            this.AdvTaiKhoanChu = new ADVAccount();
            this.Label20 = new Label();
            this.AdvDoiTuong = new ADVObjects();
            this.Label12 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label19 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.CmdTimHoaDon = new Button();
            this.CboLoaiTien = new ComboBox();
            this.TxtTyGia = new C1NumericEdit();
            this.Label14 = new Label();
            this.Label15 = new Label();
            this.Label17 = new Label();
            this.TxtNgayHoaDon = new DateTimePicker();
            this.Label18 = new Label();
            this.TxtSoHoaDon = new TextBox();
            this.Panel1 = new Panel();
            this.TxtTyLeThuLai = new C1NumericEdit();
            this.TxtTongThanhToanNT = new C1NumericEdit();
            this.TxtTongThanhToan = new C1NumericEdit();
            this.Label4 = new Label();
            this.TxtThuLaiNT = new C1NumericEdit();
            this.TxtThuLai = new C1NumericEdit();
            this.Label3 = new Label();
            this.CKShowSeriCol = new CheckBox();
            this.TxtTongHoaHongNT = new C1NumericEdit();
            this.TxtTongHoaHong = new C1NumericEdit();
            this.Label2 = new Label();
            this.Label5 = new Label();
            this.PNDungChung = new Panel();
            this.CmdChuyen = new Button();
            this.CboLoaiDuLieu = new ComboBox();
            this.ToolStrip1.SuspendLayout();
            this.TabControl2.SuspendLayout();
            this.TabPage2.SuspendLayout();
            this.VSHangHoa.BeginInit();
            this.TabControl1.SuspendLayout();
            this.TabPage1.SuspendLayout();
            ((ISupportInitialize) this.TxtTyGia).BeginInit();
            this.Panel1.SuspendLayout();
            ((ISupportInitialize) this.TxtTyLeThuLai).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToan).BeginInit();
            ((ISupportInitialize) this.TxtThuLaiNT).BeginInit();
            ((ISupportInitialize) this.TxtThuLai).BeginInit();
            ((ISupportInitialize) this.TxtTongHoaHongNT).BeginInit();
            ((ISupportInitialize) this.TxtTongHoaHong).BeginInit();
            this.PNDungChung.SuspendLayout();
            this.SuspendLayout();
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.CmdExit, this.ToolStripButton2, this.CmdGhiSo, this.CmdBoGhiSo });
            Point point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            Size size = new Size(0x37e, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x4d, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x25, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.ToolStripButton2.Alignment = ToolStripItemAlignment.Right;
            this.ToolStripButton2.Image = (Image) manager.GetObject("ToolStripButton2.Image");
            this.ToolStripButton2.ImageScaling = ToolStripItemImageScaling.None;
            this.ToolStripButton2.ImageTransparentColor = Color.White;
            this.ToolStripButton2.Name = "ToolStripButton2";
            size = new Size(0x35, 0x16);
            this.ToolStripButton2.Size = size;
            this.ToolStripButton2.Text = "&Help";
            this.CmdGhiSo.Image = (Image) manager.GetObject("CmdGhiSo.Image");
            this.CmdGhiSo.ImageTransparentColor = Color.White;
            this.CmdGhiSo.Name = "CmdGhiSo";
            size = new Size(60, 0x16);
            this.CmdGhiSo.Size = size;
            this.CmdGhiSo.Text = "Ghi sổ";
            this.CmdGhiSo.Visible = false;
            this.CmdBoGhiSo.Image = (Image) manager.GetObject("CmdBoGhiSo.Image");
            this.CmdBoGhiSo.ImageTransparentColor = Color.Magenta;
            this.CmdBoGhiSo.Name = "CmdBoGhiSo";
            size = new Size(0x54, 0x16);
            this.CmdBoGhiSo.Size = size;
            this.CmdBoGhiSo.Text = "Huỷ ghi sổ";
            this.CmdBoGhiSo.Visible = false;
            this.TabControl2.Controls.Add(this.TabPage2);
            this.TabControl2.Dock = DockStyle.Fill;
            this.TabControl2.ImageList = this.ImageList1;
            point = new Point(0, 0xb8);
            this.TabControl2.Location = point;
            this.TabControl2.Name = "TabControl2";
            this.TabControl2.SelectedIndex = 0;
            size = new Size(0x37e, 0x137);
            this.TabControl2.Size = size;
            this.TabControl2.TabIndex = 3;
            this.TabPage2.Controls.Add(this.VSHangHoa);
            point = new Point(4, 0x1b);
            this.TabPage2.Location = point;
            this.TabPage2.Name = "TabPage2";
            Padding padding = new Padding(3);
            this.TabPage2.Padding = padding;
            size = new Size(0x376, 280);
            this.TabPage2.Size = size;
            this.TabPage2.TabIndex = 0;
            this.TabPage2.Text = "Chi tiết h\x00e0ng h\x00f3a";
            this.TabPage2.UseVisualStyleBackColor = true;
            this.VSHangHoa.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSHangHoa.ColumnInfo = manager.GetString("VSHangHoa.ColumnInfo");
            this.VSHangHoa.Dock = DockStyle.Fill;
            this.VSHangHoa.ExtendLastCol = true;
            this.VSHangHoa.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(3, 3);
            this.VSHangHoa.Location = point;
            padding = new Padding(0);
            this.VSHangHoa.Margin = padding;
            this.VSHangHoa.Name = "VSHangHoa";
            this.VSHangHoa.Rows.Count = 1;
            this.VSHangHoa.Rows.DefaultSize = 0x11;
            this.VSHangHoa.Rows.MinSize = 20;
            size = new Size(880, 0x112);
            this.VSHangHoa.Size = size;
            this.VSHangHoa.StyleInfo = manager.GetString("VSHangHoa.StyleInfo");
            this.VSHangHoa.TabIndex = 0;
            this.VSHangHoa.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.ImageList1.ImageStream = (ImageListStreamer) manager.GetObject("ImageList1.ImageStream");
            this.ImageList1.TransparentColor = Color.Transparent;
            this.ImageList1.Images.SetKeyName(0, "orders_main.png");
            this.ImageList1.Images.SetKeyName(1, "checkingacct.png");
            this.ImageList1.Images.SetKeyName(2, "billing.png");
            this.TabControl1.Controls.Add(this.TabPage1);
            this.TabControl1.Dock = DockStyle.Top;
            this.TabControl1.ImageList = this.ImageList1;
            point = new Point(0, 0x19);
            this.TabControl1.Location = point;
            this.TabControl1.Name = "TabControl1";
            this.TabControl1.SelectedIndex = 0;
            size = new Size(0x37e, 0x9f);
            this.TabControl1.Size = size;
            this.TabControl1.TabIndex = 2;
            this.TabPage1.Controls.Add(this.Label6);
            this.TabPage1.Controls.Add(this.TxtNguoiThuHuong);
            this.TabPage1.Controls.Add(this.Label1);
            this.TabPage1.Controls.Add(this.AdvTKThuLai);
            this.TabPage1.Controls.Add(this.Label26);
            this.TabPage1.Controls.Add(this.TxtDienGiai);
            this.TabPage1.Controls.Add(this.Label24);
            this.TabPage1.Controls.Add(this.Label25);
            this.TabPage1.Controls.Add(this.AdvTKDoanhThu);
            this.TabPage1.Controls.Add(this.AdvTaiKhoanChu);
            this.TabPage1.Controls.Add(this.Label20);
            this.TabPage1.Controls.Add(this.AdvDoiTuong);
            this.TabPage1.Controls.Add(this.Label12);
            this.TabPage1.Controls.Add(this.TxtNgayChungTu);
            this.TabPage1.Controls.Add(this.Label19);
            this.TabPage1.Controls.Add(this.TxtSoChungTu);
            this.TabPage1.Controls.Add(this.CmdTimHoaDon);
            this.TabPage1.Controls.Add(this.CboLoaiTien);
            this.TabPage1.Controls.Add(this.TxtTyGia);
            this.TabPage1.Controls.Add(this.Label14);
            this.TabPage1.Controls.Add(this.Label15);
            this.TabPage1.Controls.Add(this.Label17);
            this.TabPage1.Controls.Add(this.TxtNgayHoaDon);
            this.TabPage1.Controls.Add(this.Label18);
            this.TabPage1.Controls.Add(this.TxtSoHoaDon);
            this.TabPage1.ImageIndex = 1;
            point = new Point(4, 0x1b);
            this.TabPage1.Location = point;
            this.TabPage1.Name = "TabPage1";
            padding = new Padding(3);
            this.TabPage1.Padding = padding;
            size = new Size(0x376, 0x80);
            this.TabPage1.Size = size;
            this.TabPage1.TabIndex = 0;
            this.TabPage1.Text = "Th\x00f4ng tin chứng từ hoa hồng";
            this.TabPage1.UseVisualStyleBackColor = true;
            this.Label6.AutoSize = true;
            point = new Point(11, 0x6d);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x44, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x91;
            this.Label6.Text = "Người hưởng";
            point = new Point(0x5f, 0x69);
            this.TxtNguoiThuHuong.Location = point;
            this.TxtNguoiThuHuong.Name = "TxtNguoiThuHuong";
            size = new Size(0x129, 20);
            this.TxtNguoiThuHuong.Size = size;
            this.TxtNguoiThuHuong.TabIndex = 7;
            this.Label1.AutoSize = true;
            point = new Point(0x19c, 0x3d);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x3b, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x8f;
            this.Label1.Text = "TK. Thu lại";
            this.AdvTKThuLai.Conditions = "";
            this.AdvTKThuLai.DefaultValue = "";
            this.AdvTKThuLai.FieldNameFilter = "";
            this.AdvTKThuLai.KeyFilter = "";
            point = new Point(0x1ef, 0x3a);
            this.AdvTKThuLai.Location = point;
            padding = new Padding(0);
            this.AdvTKThuLai.Margin = padding;
            this.AdvTKThuLai.Name = "AdvTKThuLai";
            this.AdvTKThuLai.OnlyDigit = false;
            this.AdvTKThuLai.ReadOnly = false;
            size = new Size(0x13f, 20);
            this.AdvTKThuLai.Size = size;
            this.AdvTKThuLai.TabIndex = 10;
            this.AdvTKThuLai.UpperText = true;
            this.AdvTKThuLai.Value = "";
            this.AdvTKThuLai.WithCode = 80;
            this.Label26.AutoSize = true;
            point = new Point(0x19b, 0x54);
            this.Label26.Location = point;
            this.Label26.Name = "Label26";
            size = new Size(0x30, 13);
            this.Label26.Size = size;
            this.Label26.TabIndex = 0x8b;
            this.Label26.Text = "Diễn giải";
            point = new Point(0x1ef, 0x51);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x13f, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 11;
            this.Label24.AutoSize = true;
            point = new Point(0x19c, 11);
            this.Label24.Location = point;
            this.Label24.Name = "Label24";
            size = new Size(0x29, 13);
            this.Label24.Size = size;
            this.Label24.TabIndex = 0x8a;
            this.Label24.Text = "TK. Nợ";
            this.Label25.AutoSize = true;
            point = new Point(0x19c, 0x24);
            this.Label25.Location = point;
            this.Label25.Name = "Label25";
            size = new Size(0x52, 13);
            this.Label25.Size = size;
            this.Label25.TabIndex = 0x88;
            this.Label25.Text = "TK. Thanh to\x00e1n";
            this.AdvTKDoanhThu.Conditions = "";
            this.AdvTKDoanhThu.DefaultValue = "";
            this.AdvTKDoanhThu.FieldNameFilter = "";
            this.AdvTKDoanhThu.KeyFilter = "";
            point = new Point(0x1ef, 9);
            this.AdvTKDoanhThu.Location = point;
            padding = new Padding(0);
            this.AdvTKDoanhThu.Margin = padding;
            this.AdvTKDoanhThu.Name = "AdvTKDoanhThu";
            this.AdvTKDoanhThu.OnlyDigit = false;
            this.AdvTKDoanhThu.ReadOnly = false;
            size = new Size(0x13f, 20);
            this.AdvTKDoanhThu.Size = size;
            this.AdvTKDoanhThu.TabIndex = 8;
            this.AdvTKDoanhThu.UpperText = true;
            this.AdvTKDoanhThu.Value = "";
            this.AdvTKDoanhThu.WithCode = 80;
            this.AdvTaiKhoanChu.Conditions = "";
            this.AdvTaiKhoanChu.DefaultValue = "";
            this.AdvTaiKhoanChu.FieldNameFilter = "";
            this.AdvTaiKhoanChu.KeyFilter = "";
            point = new Point(0x1ef, 0x21);
            this.AdvTaiKhoanChu.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanChu.Margin = padding;
            this.AdvTaiKhoanChu.Name = "AdvTaiKhoanChu";
            this.AdvTaiKhoanChu.OnlyDigit = false;
            this.AdvTaiKhoanChu.ReadOnly = false;
            size = new Size(0x13f, 20);
            this.AdvTaiKhoanChu.Size = size;
            this.AdvTaiKhoanChu.TabIndex = 9;
            this.AdvTaiKhoanChu.UpperText = true;
            this.AdvTaiKhoanChu.Value = "";
            this.AdvTaiKhoanChu.WithCode = 80;
            this.Label20.AutoEllipsis = true;
            this.Label20.AutoSize = true;
            point = new Point(12, 0x54);
            this.Label20.Location = point;
            this.Label20.Name = "Label20";
            this.Label20.RightToLeft = RightToLeft.No;
            size = new Size(0x35, 13);
            this.Label20.Size = size;
            this.Label20.TabIndex = 0x6a;
            this.Label20.Text = "Đối tượng";
            this.Label20.TextAlign = ContentAlignment.TopRight;
            this.AdvDoiTuong.Conditions = "";
            this.AdvDoiTuong.LoaiDoiTuong = modGeneral.TypeObjects.TatCa;
            point = new Point(0x5f, 0x51);
            this.AdvDoiTuong.Location = point;
            this.AdvDoiTuong.Name = "AdvDoiTuong";
            this.AdvDoiTuong.ReadOnly = false;
            size = new Size(0x129, 20);
            this.AdvDoiTuong.Size = size;
            this.AdvDoiTuong.TabIndex = 6;
            this.AdvDoiTuong.UpperText = true;
            this.AdvDoiTuong.Value = "";
            this.AdvDoiTuong.WidthCode = 80;
            this.Label12.AutoSize = true;
            point = new Point(240, 0x24);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            size = new Size(0x20, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 0x68;
            this.Label12.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Custom;
            point = new Point(0x12d, 0x20);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x5b, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 3;
            this.Label19.AutoSize = true;
            point = new Point(11, 0x24);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            size = new Size(0x41, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 0x66;
            this.Label19.Text = "Số chứng từ";
            point = new Point(0x5f, 0x21);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x7c, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 2;
            this.CmdTimHoaDon.FlatStyle = FlatStyle.System;
            point = new Point(0xc7, 8);
            this.CmdTimHoaDon.Location = point;
            padding = new Padding(0);
            this.CmdTimHoaDon.Margin = padding;
            this.CmdTimHoaDon.Name = "CmdTimHoaDon";
            size = new Size(0x16, 0x16);
            this.CmdTimHoaDon.Size = size;
            this.CmdTimHoaDon.TabIndex = 0x65;
            this.CmdTimHoaDon.Text = "...";
            this.CmdTimHoaDon.UseVisualStyleBackColor = true;
            this.CboLoaiTien.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x5f, 0x39);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x7d, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 4;
            this.TxtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTyGia.DataType = typeof(double);
            this.TxtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x12d, 0x39);
            this.TxtTyGia.Location = point;
            this.TxtTyGia.Name = "TxtTyGia";
            padding = new Padding(1);
            this.TxtTyGia.Padding = padding;
            size = new Size(0x5b, 20);
            this.TxtTyGia.Size = size;
            this.TxtTyGia.TabIndex = 5;
            this.TxtTyGia.Tag = null;
            this.TxtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.TxtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label14.AutoSize = true;
            point = new Point(11, 0x3b);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            size = new Size(0x2f, 13);
            this.Label14.Size = size;
            this.Label14.TabIndex = 14;
            this.Label14.Text = "Loại tiền";
            this.Label14.TextAlign = ContentAlignment.TopRight;
            this.Label15.AutoSize = true;
            point = new Point(0xef, 0x3d);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            size = new Size(0x24, 13);
            this.Label15.Size = size;
            this.Label15.TabIndex = 0x10;
            this.Label15.Text = "Tỷ gi\x00e1";
            this.Label15.TextAlign = ContentAlignment.TopRight;
            this.Label17.AutoSize = true;
            point = new Point(240, 12);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            size = new Size(0x20, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 12;
            this.Label17.Text = "Ng\x00e0y";
            this.TxtNgayHoaDon.Enabled = false;
            this.TxtNgayHoaDon.Format = DateTimePickerFormat.Custom;
            point = new Point(0x12d, 8);
            this.TxtNgayHoaDon.Location = point;
            this.TxtNgayHoaDon.Name = "TxtNgayHoaDon";
            size = new Size(0x5b, 20);
            this.TxtNgayHoaDon.Size = size;
            this.TxtNgayHoaDon.TabIndex = 1;
            this.Label18.AutoSize = true;
            point = new Point(11, 12);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(0x3f, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 10;
            this.Label18.Text = "Số h\x00f3a đơn";
            point = new Point(0x5f, 9);
            this.TxtSoHoaDon.Location = point;
            this.TxtSoHoaDon.Name = "TxtSoHoaDon";
            this.TxtSoHoaDon.ReadOnly = true;
            size = new Size(0x67, 20);
            this.TxtSoHoaDon.Size = size;
            this.TxtSoHoaDon.TabIndex = 0;
            this.Panel1.Controls.Add(this.TxtTyLeThuLai);
            this.Panel1.Controls.Add(this.TxtTongThanhToanNT);
            this.Panel1.Controls.Add(this.TxtTongThanhToan);
            this.Panel1.Controls.Add(this.Label4);
            this.Panel1.Controls.Add(this.TxtThuLaiNT);
            this.Panel1.Controls.Add(this.TxtThuLai);
            this.Panel1.Controls.Add(this.Label3);
            this.Panel1.Controls.Add(this.CKShowSeriCol);
            this.Panel1.Controls.Add(this.TxtTongHoaHongNT);
            this.Panel1.Controls.Add(this.TxtTongHoaHong);
            this.Panel1.Controls.Add(this.Label2);
            this.Panel1.Controls.Add(this.Label5);
            this.Panel1.Dock = DockStyle.Bottom;
            point = new Point(0, 0x1ef);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x37e, 0x4a);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x98;
            this.TxtTyLeThuLai.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTyLeThuLai.DataType = typeof(short);
            this.TxtTyLeThuLai.FormatType = FormatTypeEnum.Integer;
            point = new Point(0x29b, 0x1b);
            this.TxtTyLeThuLai.Location = point;
            this.TxtTyLeThuLai.Name = "TxtTyLeThuLai";
            padding = new Padding(1);
            this.TxtTyLeThuLai.Padding = padding;
            size = new Size(0x18, 20);
            this.TxtTyLeThuLai.Size = size;
            this.TxtTyLeThuLai.TabIndex = 0x9f;
            this.TxtTyLeThuLai.Tag = null;
            this.TxtTyLeThuLai.TextAlign = HorizontalAlignment.Right;
            this.TxtTyLeThuLai.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTyLeThuLai.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTyLeThuLai.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToanNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToanNT.DataType = typeof(double);
            this.TxtTongThanhToanNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x29b, 50);
            this.TxtTongThanhToanNT.Location = point;
            this.TxtTongThanhToanNT.Name = "TxtTongThanhToanNT";
            padding = new Padding(1);
            this.TxtTongThanhToanNT.Padding = padding;
            this.TxtTongThanhToanNT.ReadOnly = true;
            size = new Size(0x74, 20);
            this.TxtTongThanhToanNT.Size = size;
            this.TxtTongThanhToanNT.TabIndex = 0x9e;
            this.TxtTongThanhToanNT.Tag = null;
            this.TxtTongThanhToanNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToanNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToanNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToanNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToan.DataType = typeof(double);
            this.TxtTongThanhToan.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x312, 50);
            this.TxtTongThanhToan.Location = point;
            this.TxtTongThanhToan.Name = "TxtTongThanhToan";
            padding = new Padding(1);
            this.TxtTongThanhToan.Padding = padding;
            this.TxtTongThanhToan.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTongThanhToan.Size = size;
            this.TxtTongThanhToan.TabIndex = 0x9d;
            this.TxtTongThanhToan.Tag = null;
            this.TxtTongThanhToan.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label4.AutoSize = true;
            point = new Point(570, 0x35);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x27, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x9c;
            this.Label4.Text = "C\x00f2n lại";
            this.TxtThuLaiNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtThuLaiNT.DataType = typeof(double);
            this.TxtThuLaiNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x2b4, 0x1b);
            this.TxtThuLaiNT.Location = point;
            this.TxtThuLaiNT.Name = "TxtThuLaiNT";
            padding = new Padding(1);
            this.TxtThuLaiNT.Padding = padding;
            this.TxtThuLaiNT.ReadOnly = true;
            size = new Size(0x5b, 20);
            this.TxtThuLaiNT.Size = size;
            this.TxtThuLaiNT.TabIndex = 0x9b;
            this.TxtThuLaiNT.Tag = null;
            this.TxtThuLaiNT.TextAlign = HorizontalAlignment.Right;
            this.TxtThuLaiNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtThuLaiNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtThuLaiNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtThuLai.BorderStyle = BorderStyle.FixedSingle;
            this.TxtThuLai.DataType = typeof(double);
            this.TxtThuLai.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x312, 0x1b);
            this.TxtThuLai.Location = point;
            this.TxtThuLai.Name = "TxtThuLai";
            padding = new Padding(1);
            this.TxtThuLai.Padding = padding;
            this.TxtThuLai.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtThuLai.Size = size;
            this.TxtThuLai.TabIndex = 0x9a;
            this.TxtThuLai.Tag = null;
            this.TxtThuLai.TextAlign = HorizontalAlignment.Right;
            this.TxtThuLai.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtThuLai.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtThuLai.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label3.AutoSize = true;
            point = new Point(0x239, 30);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x3b, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x99;
            this.Label3.Text = "Tiền thu lại";
            this.CKShowSeriCol.AutoSize = true;
            point = new Point(7, 7);
            this.CKShowSeriCol.Location = point;
            this.CKShowSeriCol.Name = "CKShowSeriCol";
            size = new Size(0x71, 0x11);
            this.CKShowSeriCol.Size = size;
            this.CKShowSeriCol.TabIndex = 0;
            this.CKShowSeriCol.Text = "Hiển thị cột số seri";
            this.CKShowSeriCol.UseVisualStyleBackColor = true;
            this.TxtTongHoaHongNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongHoaHongNT.DataType = typeof(double);
            this.TxtTongHoaHongNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x29b, 4);
            this.TxtTongHoaHongNT.Location = point;
            this.TxtTongHoaHongNT.Name = "TxtTongHoaHongNT";
            padding = new Padding(1);
            this.TxtTongHoaHongNT.Padding = padding;
            this.TxtTongHoaHongNT.ReadOnly = true;
            size = new Size(0x74, 20);
            this.TxtTongHoaHongNT.Size = size;
            this.TxtTongHoaHongNT.TabIndex = 0x97;
            this.TxtTongHoaHongNT.Tag = null;
            this.TxtTongHoaHongNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTongHoaHongNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongHoaHongNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongHoaHongNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongHoaHong.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongHoaHong.DataType = typeof(double);
            this.TxtTongHoaHong.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x312, 4);
            this.TxtTongHoaHong.Location = point;
            this.TxtTongHoaHong.Name = "TxtTongHoaHong";
            padding = new Padding(1);
            this.TxtTongHoaHong.Padding = padding;
            this.TxtTongHoaHong.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTongHoaHong.Size = size;
            this.TxtTongHoaHong.TabIndex = 150;
            this.TxtTongHoaHong.Tag = null;
            this.TxtTongHoaHong.TextAlign = HorizontalAlignment.Right;
            this.TxtTongHoaHong.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongHoaHong.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongHoaHong.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label2.AutoSize = true;
            point = new Point(0x239, 7);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x4c, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x95;
            this.Label2.Text = "Tiền hoa hồng";
            this.Label5.AutoSize = true;
            point = new Point(0x289, 30);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x15, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 160;
            this.Label5.Text = "(%)";
            this.PNDungChung.Controls.Add(this.CmdChuyen);
            this.PNDungChung.Controls.Add(this.CboLoaiDuLieu);
            point = new Point(0x267, 0x16);
            this.PNDungChung.Location = point;
            this.PNDungChung.Name = "PNDungChung";
            size = new Size(280, 0x18);
            this.PNDungChung.Size = size;
            this.PNDungChung.TabIndex = 0x99;
            this.PNDungChung.Visible = false;
            this.CmdChuyen.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            point = new Point(0xfd, 0);
            this.CmdChuyen.Location = point;
            this.CmdChuyen.Name = "CmdChuyen";
            size = new Size(0x18, 0x17);
            this.CmdChuyen.Size = size;
            this.CmdChuyen.TabIndex = 0;
            this.CmdChuyen.Text = ">";
            this.CmdChuyen.UseVisualStyleBackColor = true;
            this.CboLoaiDuLieu.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiDuLieu.FormattingEnabled = true;
            point = new Point(90, 1);
            this.CboLoaiDuLieu.Location = point;
            this.CboLoaiDuLieu.Name = "CboLoaiDuLieu";
            size = new Size(0xa3, 0x15);
            this.CboLoaiDuLieu.Size = size;
            this.CboLoaiDuLieu.TabIndex = 1;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x239);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.PNDungChung);
            this.Controls.Add(this.TabControl2);
            this.Controls.Add(this.Panel1);
            this.Controls.Add(this.TabControl1);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.KeyPreview = true;
            this.Name = "Frm_TinhHoaHong";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BH-0007";
            this.Text = "HOA HONG BAN HANG";
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.TabControl2.ResumeLayout(false);
            this.TabPage2.ResumeLayout(false);
            this.VSHangHoa.EndInit();
            this.TabControl1.ResumeLayout(false);
            this.TabPage1.ResumeLayout(false);
            this.TabPage1.PerformLayout();
            ((ISupportInitialize) this.TxtTyGia).EndInit();
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            ((ISupportInitialize) this.TxtTyLeThuLai).EndInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).EndInit();
            ((ISupportInitialize) this.TxtTongThanhToan).EndInit();
            ((ISupportInitialize) this.TxtThuLaiNT).EndInit();
            ((ISupportInitialize) this.TxtThuLai).EndInit();
            ((ISupportInitialize) this.TxtTongHoaHongNT).EndInit();
            ((ISupportInitialize) this.TxtTongHoaHong).EndInit();
            this.PNDungChung.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void InsertHoaDon(string strKhoaHoaDon)
        {
            this.cFrmKhoaHoaDon = strKhoaHoaDon;
            this.ShowDataPhieuXuat(this.cFrmKhoaHoaDon);
        }

        public bool Save()
        {
            bool flag=false;
            if (this.TxtDienGiai.Text.Trim() == "")
            {
                this.TxtDienGiai.Text = modGeneral.Tranlated("Tr\x00edch hoa hồng b\x00e1n h\x00e0ng h\x00f3a đơn số", "") + ":" + this.TxtSoHoaDon.Text;
            }
            clsHoaHong objHH = this.objHH;
            objHH.Khoa = this.cFrmKhoa;
            objHH.KhoaPhieuXuat = this.cFrmKhoaHoaDon;
            objHH.SoChungTu = this.TxtSoChungTu.Text;
            objHH.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objHH.KhoaDoiTuong = this.AdvDoiTuong.Value;
            objHH.KhoaTaiKhoanDoanhThu = this.AdvTKDoanhThu.Value;
            objHH.KhoaTaiKhoanThanhToan = this.AdvTaiKhoanChu.Value;
            objHH.KhoaTaiKhoanThuLai = this.AdvTKThuLai.Value;
            objHH.DienGiai = this.TxtDienGiai.Text;
            objHH.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
            objHH.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHH.SoTienHoaHongNT = Conversions.ToDouble(this.TxtTongHoaHongNT.Value);
            objHH.SoTienHoaHong = Conversions.ToDouble(this.TxtTongHoaHong.Value);
            objHH.SoTienThuLaiNT = Conversions.ToDouble(this.TxtThuLaiNT.Value);
            objHH.SoTienThuLai = Conversions.ToDouble(this.TxtThuLai.Value);
            objHH.TyLeThuLai = Conversions.ToInteger(this.TxtTyLeThuLai.Value);
            objHH.KhoaDonVi = modGeneral.H_CLIENT;
            objHH.DuLieu = Conversions.ToString(this.CboLoaiDuLieu.SelectedValue);
            objHH.NguoiThuHuong = this.TxtNguoiThuHuong.Text;
            if (objHH.KhoaNhanVienTao.ToString().Trim() == "")
            {
                objHH.KhoaNhanVienTao = modGeneral.H_USERID;
            }
            if (objHH.NgayTao.Trim() == "")
            {
                objHH.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            }
            objHH.KhoaNhanVienSua = modGeneral.H_USERID;
            objHH.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            return objHH.Save();
            objHH = null;
            return flag;
        }

        public bool SaveTemp()
        {
            int num2 = this.VSHangHoa.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                this.objHHCT.Khoa = Conversions.ToString(vSHangHoa[i, 0]);
                this.objHHCT.KhoaHoaHong = this.cFrmKhoa;
                this.objHHCT.KhoaPhieuXuat = this.cFrmKhoaHoaDon;
                this.objHHCT.KhoaKho = Conversions.ToString(vSHangHoa[i, 1]);
                this.objHHCT.KhoaHangHoa = Conversions.ToString(vSHangHoa[i, 3]);
                this.objHHCT.SoLoHang = Conversions.ToString(vSHangHoa[i, 6]);
                this.objHHCT.SoSeri = Conversions.ToString(vSHangHoa[i, 7]);
                this.objHHCT.NgayNhap = Conversions.ToString(vSHangHoa[i, 8]);
                this.objHHCT.HanSuDung = Conversions.ToString(vSHangHoa[i, 9]);
                this.objHHCT.KhoaDonViTinh = Conversions.ToString(vSHangHoa[i, 10]);
                this.objHHCT.QuyCach = Conversions.ToDouble(vSHangHoa[i, 12]);
                this.objHHCT.SoLuong = Conversions.ToDouble(vSHangHoa[i, 13]);
                this.objHHCT.GiaBanNT = Conversions.ToDouble(vSHangHoa[i, 14]);
                this.objHHCT.TienBanNT = Conversions.ToDouble(vSHangHoa[i, 15]);
                this.objHHCT.TyLeThue = Conversions.ToInteger(vSHangHoa[i, 0x10]);
                this.objHHCT.TienThue = Conversions.ToDouble(vSHangHoa[i, 0x11]);
                this.objHHCT.TyLeHoaHong = Conversions.ToDouble(vSHangHoa[i, 0x12]);
                this.objHHCT.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
                this.objHHCT.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
                this.objHHCT.TienHoaHongNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[i, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
                this.objHHCT.TienHoaHong = this.objHHCT.TienHoaHongNT * this.objHHCT.TyGia;
                if (!this.objHHCT.Save())
                {
                    return false;
                }
                vSHangHoa = null;
            }
            return true;
        }

        public void ShowData(string strKhoa)
        {
            this.objHH.Load(strKhoa);
            this.TxtSoChungTu.Text = this.objHH.SoChungTu;
            this.TxtNgayChungTu.Text = LVYModule.Char2Date(this.objHH.NgayChungTu);
            this.TxtDienGiai.Text = this.objHH.DienGiai;
            this.TxtTongHoaHongNT.Value = this.objHH.SoTienHoaHongNT;
            this.TxtTongHoaHong.Value = this.objHH.SoTienHoaHong;
            this.CboLoaiTien.SelectedValue = this.objHH.LoaiTien;
            this.TxtTyGia.Value = this.objHH.TyGia;
            this.AdvDoiTuong.Value = this.objHH.KhoaDoiTuong;
            this.AdvTaiKhoanChu.Value = this.objHH.KhoaTaiKhoanThanhToan;
            this.AdvTKDoanhThu.Value = this.objHH.KhoaTaiKhoanDoanhThu;
            this.AdvTKThuLai.Value = this.objHH.KhoaTaiKhoanThuLai;
            this.TxtTyLeThuLai.Value = this.objHH.TyLeThuLai;
            this.TxtThuLaiNT.Value = this.objHH.SoTienThuLaiNT;
            this.TxtThuLai.Value = this.objHH.SoTienThuLai;
            this.TxtTongThanhToanNT.Value = this.objHH.SoTienHoaHongNT - this.objHH.SoTienThuLaiNT;
            this.TxtTongThanhToan.Value = this.objHH.SoTienHoaHong - this.objHH.SoTienThuLai;
            this.objHD.Load(this.objHH.KhoaPhieuXuat);
            this.cFrmKhoaHoaDon = this.objHD.Khoa;
            this.TxtSoHoaDon.Text = this.objHD.SoChungTu;
            this.TxtNgayHoaDon.Text = LVYModule.Char2Date(this.objHD.NgayChungTu);
            this.CboLoaiDuLieu.SelectedValue = this.objHH.DuLieu;
            this.TxtNguoiThuHuong.Text = this.objHH.NguoiThuHuong;
            DataTable details = this.objHH.GetDetails(strKhoa);
            this.VSHangHoa.Rows.Count = 1;
            int num2 = details.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                vSHangHoa.AddItem("");
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Khoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaKho"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoHang"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaHangHoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Ma"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(details.Rows[i]["HangHoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLoHang"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoSeri"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(details.Rows[i]["NgayNhap"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(details.Rows[i]["HanSuDung"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaDonViTinh"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DonViTinh"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["QuyCach"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLuong"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(details.Rows[i]["GiaBanNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienBanNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TyLeThue"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienThue"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TyLeHoaHong"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x13] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienHoaHongNT"]);
                vSHangHoa = null;
            }
        }

        public void ShowDataPhieuXuat(string strKhoaHoaDon)
        {
            this.objHD.Load(strKhoaHoaDon);
            this.TxtSoHoaDon.Text = this.objHD.SoChungTu;
            this.TxtNgayHoaDon.Text = LVYModule.Char2Date(this.objHD.NgayChungTu);
            this.CboLoaiTien.SelectedValue = this.objHD.LoaiTien;
            this.TxtTyGia.Value = this.objHD.TyGia;
            this.AdvDoiTuong.Value = this.objHD.KhoaDoiTuong;
            this.TxtDienGiai.Text = modGeneral.Tranlated("T\x00ednh hoa hồng h\x00f3a đơn số", "") + ": " + this.objHD.SoChungTu;
            this.VSHangHoa.Rows.Count = 1;
            DataTable listDetails = this.objHD.GetListDetails(strKhoaHoaDon);
            int num2 = listDetails.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                vSHangHoa.AddItem("");
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Khoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaKho"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoHang"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaHangHoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Ma"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["HangHoa"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoLoHang"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoSeri"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["NgayNhap"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["HanSuDung"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaDonViTinh"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["DonViTinh"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["QuyCach"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoLuong"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["GiaBanNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienBanNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TyLeThue"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienThueNT"]);
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x12] = 0;
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x13] = 0;
                vSHangHoa = null;
            }
        }

        public void TinhTienThuLai()
        {
            int num = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyLeThuLai.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtThuLaiNT.Value = Math.Round((double) ((Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongHoaHongNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num) / 100.0), this.objLT.SoLe);
            this.TxtThuLai.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThuLaiNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTongThanhToanNT.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongHoaHongNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThuLaiNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTongThanhToan.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongHoaHong.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThuLai.Value), 0, modGeneral.TypeOfValue.Nothing));
        }

        public void TinhTong()
        {
            this.TxtTongHoaHongNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 0x13);
            this.TxtTongHoaHong.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongHoaHongNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
        }

        private void TxtTyLeThuLai_LostFocus(object sender, EventArgs e)
        {
            this.TinhTienThuLai();
        }

        private void VSHangHoa_AfterEdit(object sender, RowColEventArgs e)
        {
            int num3 = 0;
            double num = 0.0;
            double num2 = 0.0;
            switch (e.Col)
            {
                case 0x12:
                    num3 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
                    num2 = Math.Round((double) ((Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 15]), 0, modGeneral.TypeOfValue.Nothing)) * num3) / 100.0), this.objLT.SoLe);
                    this.VSHangHoa[e.Row, 0x13] = num2;
                    break;

                case 0x13:
                    num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
                    num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 15]), 0, modGeneral.TypeOfValue.Nothing));
                    num3 = (int) Math.Round(Math.Round((double) ((num2 * 100.0) / num), 2));
                    this.VSHangHoa[e.Row, 0x12] = num3;
                    break;
            }
            this.TinhTong();
            this.TinhTienThuLai();
        }

        private void VSHangHoa_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if (e.Col < 0x12)
            {
                e.Cancel = true;
            }
        }

        internal virtual ADVObjects AdvDoiTuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvDoiTuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvDoiTuong = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanChu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanChu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanChu = value;
            }
        }

        internal virtual ADVAccount AdvTKDoanhThu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKDoanhThu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKDoanhThu = value;
            }
        }

        internal virtual ADVAccount AdvTKThuLai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKThuLai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKThuLai = value;
            }
        }

        internal virtual ComboBox CboLoaiDuLieu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiDuLieu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiDuLieu = value;
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKShowSeriCol
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKShowSeriCol;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKShowSeriCol_CheckedChanged);
                if (this._CKShowSeriCol != null)
                {
                    this._CKShowSeriCol.CheckedChanged -= handler;
                }
                this._CKShowSeriCol = value;
                if (this._CKShowSeriCol != null)
                {
                    this._CKShowSeriCol.CheckedChanged += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdBoGhiSo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdBoGhiSo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdBoGhiSo = value;
            }
        }

        internal virtual Button CmdChuyen
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdChuyen;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdChuyen = value;
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdGhiSo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdGhiSo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdGhiSo = value;
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button CmdTimHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTimHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdTimHoaDon_Click);
                if (this._CmdTimHoaDon != null)
                {
                    this._CmdTimHoaDon.Click -= handler;
                }
                this._CmdTimHoaDon = value;
                if (this._CmdTimHoaDon != null)
                {
                    this._CmdTimHoaDon.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.AdvTaiKhoanChu.ReadOnly = !value;
                this.AdvTKDoanhThu.ReadOnly = !value;
                this.AdvDoiTuong.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtTyGia.ReadOnly = !value;
                this.TxtTyLeThuLai.ReadOnly = !value;
                this.AdvTKThuLai.ReadOnly = !value;
                this.CboLoaiDuLieu.Enabled = value;
                this.CmdChuyen.Enabled = !value;
                this.TxtNguoiThuHuong.ReadOnly = !value;
                this.CmdTimHoaDon.Enabled = value;
            }
        }

        internal virtual ImageList ImageList1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ImageList1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ImageList1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label24
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label24;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label24 = value;
            }
        }

        internal virtual Label Label25
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label25;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label25 = value;
            }
        }

        internal virtual Label Label26
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label26;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label26 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel PNDungChung
        {
            [DebuggerNonUserCode]
            get
            {
                return this._PNDungChung;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._PNDungChung = value;
            }
        }

        internal virtual TabControl TabControl1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl1 = value;
            }
        }

        internal virtual TabControl TabControl2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl2 = value;
            }
        }

        internal virtual TabPage TabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage1 = value;
            }
        }

        internal virtual TabPage TabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage2 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripButton ToolStripButton2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual DateTimePicker TxtNgayHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayHoaDon = value;
            }
        }

        internal virtual TextBox TxtNguoiThuHuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNguoiThuHuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNguoiThuHuong = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual TextBox TxtSoHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoHoaDon = value;
            }
        }

        internal virtual C1NumericEdit TxtThuLai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtThuLai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtThuLai = value;
            }
        }

        internal virtual C1NumericEdit TxtThuLaiNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtThuLaiNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtThuLaiNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongHoaHong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongHoaHong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongHoaHong = value;
            }
        }

        internal virtual C1NumericEdit TxtTongHoaHongNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongHoaHongNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongHoaHongNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToan = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToanNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTyGia = value;
            }
        }

        internal virtual C1NumericEdit TxtTyLeThuLai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTyLeThuLai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTyLeThuLai_LostFocus);
                if (this._TxtTyLeThuLai != null)
                {
                    this._TxtTyLeThuLai.ValueChanged -= handler;
                }
                this._TxtTyLeThuLai = value;
                if (this._TxtTyLeThuLai != null)
                {
                    this._TxtTyLeThuLai.ValueChanged += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSHangHoa
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSHangHoa;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSHangHoa_BeforeEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSHangHoa_AfterEdit);
                if (this._VSHangHoa != null)
                {
                    this._VSHangHoa.BeforeEdit -= handler;
                    this._VSHangHoa.AfterEdit -= handler2;
                }
                this._VSHangHoa = value;
                if (this._VSHangHoa != null)
                {
                    this._VSHangHoa.BeforeEdit += handler;
                    this._VSHangHoa.AfterEdit += handler2;
                }
            }
        }
    }
}

